/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package flightlifter;

import java.util.Vector;
import org.lwjgl.opengl.GL11;

/**
 *
 * @author Matt
 */
public class ParticleSystem {

    Vector <Particle> particles = new Vector();

    Vector toRemove;
    public void physics(){

        toRemove = new Vector();
        for (Particle p:particles){
            p.physics();
            if (p.life > p.maxLife) toRemove.add(p);
        }

        particles.removeAll(toRemove);
    }

    public void render(){

        GL11.glDisable(GL11.GL_DEPTH_TEST);

        for (Particle p:particles){
            p.render();
        }
        GL11.glEnable(GL11.GL_DEPTH_TEST);

    }



}


